home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / KEYBOARD.SWG / 0049_Flush-Stuff Keyboard.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  657b  |  38 lines

  1. {From: MARK OUELLET}
  2. { FLUSH/STUFF Keyboard w/INT21}
  3.  
  4. PROGRAM StuffKbdTest;
  5. uses dos;
  6.  
  7.   procedure FlushKbd; Assembler;
  8.  
  9.     asm
  10.       Mov AX, $0C00;
  11.       Int 21h;
  12.     end;
  13.  
  14.   procedure StuffKbd(S:string);
  15.  
  16.         var
  17.       Regs : registers;
  18.       x : byte;
  19.       BufferFull : boolean;
  20.  
  21.     begin
  22.       FlushKbd;
  23.       Inc(S[0]);
  24.       S[byte(S[0])] := #13;
  25.       x := 1;
  26.       repeat
  27.         Regs.AH := $05;
  28.         Regs.CL := Byte(S[x]);
  29.         Intr($16, Regs);
  30.         BufferFull := boolean(Regs.AL);
  31.         inc(x);
  32.       until BufferFull or (x>byte(S[0]));
  33.     end;
  34.  
  35.   begin
  36.         StuffKbd('Dir C:\');
  37.   end.
  38.